import { type IMaterial, Root } from '@dev-crafter/editor-core'
import { ButtonMaterial, DefaultSlotMaterial, IconViewMaterial, InputMaterial, TextAreaMaterial, TextMaterial } from '@dev-crafter/editor-antdv'
import { AntButtonMaterial } from 'antd-materials'

export interface ResourceGroup {
  titleKey: string
  items: string[]
}

export const materials: IMaterial[] = [
  {
    componentName: 'Root',
    component: Root,
    designer: Root,
  },
  ButtonMaterial,
  TextMaterial,
  IconViewMaterial,
  InputMaterial,
  TextAreaMaterial,
  // slots
  DefaultSlotMaterial,
  // react
  AntButtonMaterial,
]

export const resources: ResourceGroup[] = [
  {
    titleKey: 'inputs',
    items: [
      ButtonMaterial.componentName,
      AntButtonMaterial.componentName,
      InputMaterial.componentName,
      TextAreaMaterial.componentName,
    ],
  },
  {
    titleKey: 'displays',
    items: [
      TextMaterial.componentName,
      IconViewMaterial.componentName,
    ],
  },
]

interface IPlatform {
  platform: string
  resources: ResourceGroup[]
}
// 翻译：多平台
export const mutiPlatforms: IPlatform[] = [
  {
    platform: 'vue',
    resources: [
      {
        titleKey: 'inputs',
        items: [
          ButtonMaterial.componentName,
          InputMaterial.componentName,
          TextAreaMaterial.componentName,
        ],
      },
      {
        titleKey: 'displays',
        items: [
          TextMaterial.componentName,
          IconViewMaterial.componentName,
        ],
      },
    ],
  },
  {
    platform: 'react',
    resources: [
      {
        titleKey: 'inputs',
        items: [
          AntButtonMaterial.componentName,
        ],
      },
    ],
  },
]
